const allRequest = {
	register(data) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: 'http://test.api.w-lans.cn/api/v1.0/user/register',
				data: data,
				method: 'POST',
				success: ({
					data
				}) => {
					if (data.ErrCode == 0) {
						resolve(data.Result);
					} else {
						reject('注册失败，请重试');
					}
				}
			})
		})
	},
	signIn(data) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: 'http://test.api.w-lans.cn/api/v1.0/user/login',
				data: data,
				method: 'POST',
				success: ({
					data
				}) => {
					if (data.ErrCode == 0) {
						resolve(data.Result);
					} else {
						reject('登陆失败，请重试');
					}
				}
			})
		})
	},
	recordList(data) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: 'http://test2.api.w-lans.cn/api/v1.0/studio/recordList',
				data: data,
				method: 'POST',
				success: ({
					data
				}) => {
					if (data.ErrCode == 0) {
						resolve(data.Result);
					} else {
						resolve(false)
					}
				}
			})
		})
	},
	recordSearch(data) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: 'http://test2.api.w-lans.cn/api/v1.0/studio/recordSearch',
				data: data,
				method: 'POST',
				success: ({
					data
				}) => {
					if (data.ErrCode == 0) {
						resolve(data.Result);
					} else {
						resolve(false)
					}
				}
			})
		})
	}
}
export default allRequest;
